<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<nav id="navbar1" class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top">
    <div class="container">
        <a class="navbar-brand" href="index.jsp">送你一朵 <img src="img/ani.gif" height="40"></a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse"
                data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
                aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav nav-pills mb-2 mb-lg-0 ms-auto" role="tablist">
                <li class="nav-item">
                    <a class="nav-link" aria-current="page" href="index.jsp#carouselExampleCaptions">主页</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="index.jsp#people">演员职员</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="index.jsp#story">剧情简介</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="index.jsp#lines">戳心台词</a>
                </li>
                <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#d" id="navbarDropdown" role="button"
                       data-bs-toggle="dropdown" aria-expanded="false">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                             class="bi bi-person-circle" viewBox="0 0 16 16">
                            <path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"/>
                            <path fill-rule="evenodd"
                                  d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm8-7a7 7 0 0 0-5.468 11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1z"/>
                        </svg>
                    </a>
                    <ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="navbarDropdown">
                        <%
                            if (session.getAttribute("username") != null) {
                                out.println("<li><a class=\"dropdown-item\" href=\"./publish.jsp\">发表影评</a></li>\n" +
                                        "                            <li><a class=\"dropdown-item\" href=\"./read.jsp\">观看影评</a></li>\n" +
                                        "                            <li>\n" +
                                        "                                <hr class=\"dropdown-divider\">\n" +
                                        "                            </li>\n" +
                                        "                            <li><a class=\"dropdown-item\" href=\"./logout.jsp\">退出登陆</a></li>");

                            } else {
                                out.println("<li><a class=\"dropdown-item\" href=\"./register.jsp\">注册</a></li>\n" +
                                        "                            <li><a class=\"dropdown-item\" href=\"./login.jsp\">登陆</a></li>");
                            }
                        %>

                    </ul>
                </li>
            </ul>
        </div>
    </div>
</nav>